--[[
    NuckPluck - An android game for learning the Thai alphabet
    Copyright (C) 2013 Nathan Kieffer

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Contact: nathankieffer@gmail.com
--]]
local physics = require("physics")
--local vector = require("vector")
physics.start()
local Block = {}

function Block.newBlock(parent, x, y)
   local block = display.newGroup()
   local container = display.newImage(block, "images/tile_brick.png")
   container:setFillColor(.7,.7,0)
   parent:insert(block)
   block.x = (x * 50)
   block.y = (y * 50)
   block.startx = (x * 50)
   block.starty = (y * 50)
   block:toFront()
   block.type="block"
   physics.addBody(block, "static", {isSensor = false, density=100, 
				      friction=100, bounce=0,
				      filter={ categoryBits=4,
					       maskBits=25} })
   block.type = "block"
   return block
end

return Block
